﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace CRMSalesManagement.FrontPageShow
{
    public partial class MessagesShow : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                //通知
                int pageNum = 1;
                if (Request.QueryString["page"] != null)
                {
                    pageNum = int.Parse(Request.QueryString["page"]);
                }
                int total = 0;
                var messageDb =CRM.Business.Messages.PagePublishedListVisitorMessage(out total, pageNum, this.DataPage1.ShowRecordCount);
                this.DataPage1.TotalRecordCount = total;
                this.DataPage1.ShowPageNumberCount = pageNum;
                if (messageDb != null)
                {
                    this.dlMessage.DataSource = messageDb;
                    this.dlMessage.DataBind();
                }

                #region 控制分页控件
                CRM.Business.ShowPageDispaly.PageDispaly(this.DataPage1, pageNum, total);
                #endregion
            }
        }
        protected void btnAddMessage_Click(object sender, EventArgs e)
        {
            Response.Redirect("/FrontPageShow/AddMessage.aspx", false);
        }
    }
}